
/*
 *************************************************************************
 *西瑞克斯研发管理系统
 *版 本: 1.0   
 *日 期：02/08/2012    
 *作 者： 王浩 QQ：873987060   
 *************************************************************************   
 */
package com.application.function.service;

import java.util.List;
import com.manager.BaseService;
import com.manager.commons.page.PageBean;
import com.application.function.entity.Function;
import com.application.function.entity.Menu;
import com.application.function.struts.form.FunctionForm;
import com.application.function.dao.FunctionDAO;
import com.application.model.entity.Model;
import com.application.role.entity.Role;

/**
 * 
 * Description:FunctionService<br />
 * 
 * Version:V0.1<br />
 * 
 * Author: 左磊 QQ：30575951 <br />
 * 
 * History: <br />
 * 
 * 02/08/2012
 * 
 */
public class FunctionService extends BaseService {
	private FunctionDAO functionDAO;

	public FunctionDAO getFunctionDAO() {
		return this.functionDAO;
	}

	public void setFunctionDAO(FunctionDAO functionDAO) {
		this.functionDAO = functionDAO;
	}

	public Function getFunction(Function function) {
		return (Function) this.getBaseDao().queryByPk(function,
				function.getId());
	}

	public Integer getAllCountFunction(FunctionForm functionForm) {
		return this.functionDAO.getAllCountFunction(functionForm);
	}

	public List<Function> searchFunction(FunctionForm functionForm,
			PageBean pageBean) throws Exception {
		List<Function> functionList = (List) this.functionDAO.searchFunction(
				functionForm, pageBean);
		return functionList;
	}

	public void deleteFunctions(FunctionForm functionForm) {
		this.functionDAO.deleteFunctions(functionForm);
	}

	public List searchFunction(final FunctionForm functionForm) {
		List<Function> functionList = (List) this.functionDAO
				.searchFunction(functionForm);
		return functionList;
	}
	public List<Menu> searchFunctionMenu(String mid, String uid){
		return this.functionDAO.searchFunctionMenu(mid, uid);
	}
	public void deleteFunctionRole(String fid) {
		this.functionDAO.deleteFunctionRole(fid);
	}

	public List<Role> getFunctionRole(String fid) {
		return this.functionDAO.getFunctionRole(fid);
	}
	
    public List<Function> searchFunctionMenu(String mid){ 
    	return this.functionDAO.searchFunctionMenu(mid);
    }
}
